Sequence grabber components allow you to define a number of callback functions in your application. The sequence grabber calls your functions at specific points in the process of collecting, compressing, and displaying the source video data. By defining callback functions, you can control the process more precisely or customize the operation of the sequence grabber component.
For example, you could use a callback function to draw a frame number on each video frame as it is collected. You could use either a compress callback function or a grab-complete callback function to accomplish this. The compress callback function is called after each frame is collected, in order to compress the frame. The grab-complete callback function is called just before the compress callback function, as soon as the frame has been captured.
The SGSetVideoBottlenecks function lets you assign callback functions to a video channel. You can use the SGGetVideoBottlenecks function to determine the callback functions that have been assigned to a video channel.
The SGSetVideoBottlenecks function accepts a video bottlenecks structure that identifies the callback functions to be assigned to the channel. In addition, the SGGetVideoBottlenecks function contains a pointer to this structure.
The video bottlenecks structure is defined by the VideoBottles data type as follows:
struct VideoBottles {
short procCount; /* count of callbacks */
GrabProc grabProc; /* grab function */
GrabCompleteProc grabCompleteProc; /* grab-complete function */
DisplayProc displayProc; /* display function */
CompressProc compressProc; /* compress function */
CompressCompleteProc compressCompleteProc;
/* compress-complete
function */
AddFrameProc addFrameProc; /* add-frame function */
TransferFrameProc transferFrameProc; /* transfer-frame function */
GrabCompressCompleteProc grabCompressCompleteProc;
/* grab-compress-complete
function */
DisplayCompressProc displayCompressProc;
/* display-compress
function */
};
typedef struct VideoBottles VideoBottles;
The SGSetVideoBottlenecks function assigns callback functions to a video channel.
pascal ComponentResult SGSetVideoBottlenecks (SGChannel c,
VideoBottles *vb);
The SGGetVideoBottlenecks function allows you to determine the callback functions that have been assigned to a video channel.
pascal ComponentResult SGGetVideoBottlenecks (SGChannel c,
VideoBottles *vb);